/*------------------------------------------------------------------------------
 * @file    U8X8CB.H
 * @author  嵌入式王子
 * @email   donminedm@163.com
 * @date    2024/07/17 21:47:18
 * @brief   开源的嵌入式软件包，本人不对此代码负责任
 * -----------------------------------------------------------------------------*/

#ifndef _U8x8CB_H_
#define _U8x8CB_H_

#include <stdint.h>

#include "main.h"

#include "i2c.h"
#include "u8g2.h"

#include "FreeRTOS.h"
#include "delay.h"
#include "task.h"

/**
 * @brief 屏幕通讯口
 *
 */
#define OLED_HANDLE (&hi2c1)

#define U8G2_USE_DYNAMIC_ALLOC 0

#define OLED_BUFF_SIZE 200
#define OLED_MSG_TIMEOUT 1000

/**
 * @brief 屏幕I2C地址
 *
 */
enum
{
    OLED_SSD1306_ADDR = 0x78, // 0x7A
    OLED_SSH1106_ADDR = 0x3C, // 0x3D
};

#define OLED_ADDRESS OLED_SSD1306_ADDR

void u8g2Init(u8g2_t *u8g2);

// HAL库 HAL_Delay
#define OLED_DELAY_MS vTaskDelay
#define OLED_DELAY_US delay_us

#endif